n = int(input())
s = input().split()
a = [0 for i in range(0, 50000)]
L = 1
R = n
ans = 0
for i in range(0, n):
	a[i + 1] = int(s[i])
while L <= R - 1:
	temp = a[L] ^ a[L + 1]
	R = R + 1
	a[R] = temp
	ans = ans + temp
	L = L + 2
print(ans)
